package com.nineclock.system.feign;

import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCompanyUserDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

@FeignClient("sys-service")//被调用微服务的名称
public interface SysCompanyUserFeign {
    // 根据用户ID, 企业ID查询企业员工的基本信息、角色权限信息
    @GetMapping("/companyUser/query")
    public Result<List<SysCompanyUserDTO>> queryCompanyUser(@RequestParam Long userId,@RequestParam Long companyId);
    /**
     * 根据员工ID查询员工信息
     * @param companyUserId
     * @return
     */
    @GetMapping("/companyUser/query/{companyUserId}")
    public Result<SysCompanyUserDTO> queryCompanyUserById(@PathVariable Long companyUserId);
    /**
     * 查询当前企业所有员工
     * @return
     */
    @ApiOperation(value = "查询当前企业所有的员工")
    @GetMapping("companyUser/queryAllUser")
    public Result<List<SysCompanyUserDTO>> queryAllCompanyUser();
    /**
     * 获取当前企业的所有部门id
     * @return
     */
    @GetMapping("/organization/department/top")
    public Result<List<Long>> queryDepartmentIds();
    /**
     * 查询指定部门集合下员工的数量
     */
    @GetMapping("/organization/department/membernum")
    public Result<Integer> queryUserCountByDepartmentId(@RequestParam("departmentIds") List<Long> departmentIds);
    /**
     * 根据员工id获得从低到高级别的部门ID集合
     * @param
     * @return
     */
    @GetMapping("organization/allDepId/{companyUserId}")
    public Result<List<Long>> queryDepartmentsByUserId(@PathVariable Long companyUserId);
}
